! Roel Matthysen
! s0202264
! 1e Master Wiskundige Ingenieurstechnieken
!
! Output meegeleverd voor :
! g95           0.92
! gfortran      4.4.3
! nagfor        5.3
! ifort         12.0
! Eigen machine (Mac OS X):
! gfortran      4.7.0

program main
implicit none
integer, parameter :: dp = kind(0d0)
integer, parameter :: sp = kind(0e0)
!Double Precision loopt tot decimale precisie 15, dus voor extended wordt 16 gevraagd
integer, parameter :: ep = max(dp,selected_real_kind(16,1))
!Extended Precision loopt tot decimale precisie 18, dus voor quadruple wordt 19 gevraagd
integer, parameter :: qp = max(dp,selected_real_kind(19,1))
write(*,*) '---------------------'
write(*,*) 'Single Precision'
write(*,*) '---------------------'
write(*,*) 'Length of mantisse : ', digits(0.0_sp)
write(*,*) 'Minimal exponent : ', minexponent(0.0_sp)
write(*,*) 'Maximal exponent : ', maxexponent(0.0_sp)
write(*,*) 'Decimal precision : ', precision(0.0_sp)
write(*,*) 'Decimal exponent range : ',range(0.0_sp)
write(*,*) 'Machine precision : ', epsilon(0.0_sp)
write(*,*) '---------------------'
write(*,*) 'Double Precision'
write(*,*) '---------------------'
write(*,*) 'Length of mantisse : ', digits(0.0_dp)
write(*,*) 'Minimal exponent : ', minexponent(0.0_dp)
write(*,*) 'Maximal exponent : ', maxexponent(0.0_dp)
write(*,*) 'Decimal precision : ', precision(0.0_dp)
write(*,*) 'Decimal exponent range : ',range(0.0_dp)
write(*,*) 'Machine precision : ', epsilon(0.0_dp)
!Alles met precisie kleiner dan 32 wordt als extended beschouwd
write(*,*) '---------------------'
write(*,*) 'Extended Precision'
write(*,*) '---------------------'
if(ep/=dp .and. precision(0.0_ep)<32) then
write(*,*) 'Length of mantisse : ', digits(0.0_ep)
write(*,*) 'Minimal exponent : ', minexponent(0.0_ep)
write(*,*) 'Maximal exponent : ', maxexponent(0.0_ep)
write(*,*) 'Decimal precision : ', precision(0.0_ep)
write(*,*) 'Decimal exponent range : ',range(0.0_ep)
write(*,*) 'Machine precision : ', epsilon(0.0_ep)
else
write(*,*) 'Not present'
endif
!Alles met precisie hoger dan 32 wordt als quadruple beschouwd
write(*,*) '---------------------'
write(*,*) 'Quadruple Precision'
write(*,*) '---------------------'
if(qp>dp .and. precision(0.0_qp)>32) then
write(*,*) 'Length of mantisse : ', digits(0.0_qp)
write(*,*) 'Minimal exponent : ', minexponent(0.0_qp)
write(*,*) 'Maximal exponent : ', maxexponent(0.0_qp)
write(*,*) 'Decimal precision : ', precision(0.0_qp)
write(*,*) 'Decimal exponent range : ',range(0.0_qp)
write(*,*) 'Machine precision : ', epsilon(0.0_qp)
else
write(*,*) 'Not present'
endif

end program
